import { mapGetters } from 'vuex';
import {  } from '../../service/getData.js';
export const IamLogin = {
    data () {
        return {
            index:0
        }
    },
    computed : {
        ...mapGetters([
            'isFrist',
        ])
    },
    mounted (){
        if(this.isFrist){
            this.selectLogin();
        }else{
            
        }
    },
    components : {

    },
    methods : {
        selectLogin(){
            if(process.env.NODE_ENV == 'development'){
                //模拟登录
                this.apiLogin();
            }else{
                //app环境服务
                this.appLogin();
            }
        },
        //模拟登录
        apiLogin(){
            // this.$toast.loading({
            //     mask:true,
            //     message: '加载中...',
            //     duration:0
            // });
            // this.$toast.clear();
            // this.$toast.loading({
            //     type:"fail",
            //     forbidClick: true,
            //     message: '登录接口失败',
            //     duration:1500
            // });
            //this.$store.dispatch('setFrist',false);
        },
        //app环境服务
        appLogin(){
            
        },
        getUrlData:function(name){
            var _this = this;
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r != null) return unescape(r[2]);
            return null;
        },
    }
}
